using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication11.Models.Mapping
{
    public class sport_answer_lineMap : EntityTypeConfiguration<sport_answer_line>
    {
        public sport_answer_lineMap()
        {
            // Primary Key
            this.HasKey(t => t.sport_line_id);

            // Properties
            this.Property(t => t.question_no)
                .HasMaxLength(20);

            // Table & Column Mappings
            this.ToTable("sport_answer_line");
            this.Property(t => t.sport_line_id).HasColumnName("sport_line_id");
            this.Property(t => t.question_no).HasColumnName("question_no");
            this.Property(t => t.days).HasColumnName("days");
            this.Property(t => t.hours).HasColumnName("hours");
            this.Property(t => t.minutes).HasColumnName("minutes");
            this.Property(t => t.sport_short_answer_sheet_id).HasColumnName("sport_short_answer_sheet_id");

            // Relationships
            this.HasOptional(t => t.sport_short_answer_sheet)
                .WithMany(t => t.sport_answer_line)
                .HasForeignKey(d => d.sport_short_answer_sheet_id);

        }
    }
}
